﻿using Little.Soldier.SWIFT.Validation;
using System.Reflection;

namespace Little.Soldier.SWIFT.Validation.Block2
{
  public class Validate_MessageType : ValidatePropertyBase
  {
    public Validate_MessageType(PropertyInfo validateProperty, object parentPropertyObject)
      : base(validateProperty, parentPropertyObject)
    {
    }

    public Validate_MessageType(PropertyInfo validateProperty, object parentPropertyObject, bool allowEmptyValue)
      : base(validateProperty, parentPropertyObject, allowEmptyValue)
    {
    }

    protected override void InitializeRules()
    {
      this.Rules.Add((ValidationRuleBase) new ValidationRule_Length(3));
      this.Rules.Add((ValidationRuleBase) new ValidationRule_RegEx("\\d{3}"));
    }
  }
}
